package com.syh.niceweibo.data;

import android.content.Context;

public class DBServer {
    private static DBServer instance;
    public HotWeiboDao hotWeiboInfoDao;

    private DBadapter db;
    private DBServer(Context context){
        db=new DBadapter(context);
        db.open();
        hotWeiboInfoDao=new HotWeiboDao(db);
    }
    public static synchronized DBServer open(Context context){
    	if(instance==null){
            instance=new DBServer(context);
        }
        return instance;
    }
    
    public void close(){
        if(db!=null){
            db.close();
        }
        instance=null;
    }
}
